﻿@{
    ViewBag.Title = "ListBookingStation";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}
<script type="text/javascript">
    $(function () {
        $("#txtDay").datepicker({
            showOn: "button",
            dateFormat: 'yy-mm-dd',
            buttonImage: "/Content/images/calendar.gif",
            buttonImageOnly: true
        });

        $("#dvUpload").fileUpload({
            'uploader': '/Scripts/uploader.swf',
            'cancelImg': '/Images/cancel.png',
            'buttonText': 'Upload file',
             'script': "@Url.Action("UploadAvatar", "customer")",     
            'onComplete': function (event, queueID, fileObj, response, data) {
                $("#txtUrl").val(response);
            },
            'folder': '/uploads',
            'fileDesc': 'Music Files',
            'fileExt': '*.mp3',
            'multi': true,
            'auto': true
        });

    });
</script>
<h2>
    @ViewBag.DetailTitle</h2>
<table style="width: 100%;">
    <tr>
        <th style="width: 70px">
        </th>
        <th style="width: 70px">
            Tháng
        </th>
        <th style="width: 150px">
            Ngày
        </th>
        <th style="width: 100px">
            Đơn giá
        </th>
        <th style="width: 100px">
            Xóa
        </th>
    </tr>
    @foreach (VoiceAd.Models.tblBlock objBlock in ViewBag.lstBooking)
    {
        <tr>
            <td>@Html.ActionLink("Thay đổi", "ChangeDay", new { id = objBlock.Id })
            </td>
            <td>@objBlock.MonthBook
            </td>
            <td>@objBlock.DayBook
            </td>
            <td>@objBlock.MonthPrice
            </td>
            <td>
                @Html.ActionLink("Xóa", "DeleteBlockById", new { id = objBlock.Id }, new { onclick = "return confirm('Bạn có muốn xóa tin này không ?')" })
            </td>
        </tr>
    }
</table>
<h2>
    Danh sách file monitor do nhà đài up</h2>
<table style="width: 100%;">
    <tr>
        <th style="width: 50px">
        </th>
        <th style="width: 100px">
            Ngày
        </th>
        <th style="width: 500px">
            Link
        </th>
        <th style="width: 240px">
            Nghe
        </th>
    </tr>
    @{
        int strIdVoice = 0;
        string idPlayerVoice = "IdPlayerVoice";                
    }
    @foreach (VoiceAd.Models.tblMonitor objMontor in ViewBag.lstMonitor)
    {
        idPlayerVoice = idPlayerVoice + strIdVoice.ToString();           
       
        <tr>
            <td>@Html.ActionLink("Xoá", "DeleteMonitor", new { id = objMontor.Id, BookingId = objMontor.BookingId }, new { onclick = "return confirm('Bạn có muốn xóa file này không ?')" })
            </td>
            <td>@objMontor.UploadDay.Value.ToString("dd/MM/yyyy")
            </td>
            <td>@objMontor.UrlFile
            </td>
            <td>
                <div id="@idPlayerVoice">
                </div>
                <script type="text/javascript">
                    jwplayer("@idPlayerVoice").setup({
                        modes: [{ type: 'html5' }, { type: 'flash', src: 'jwplayer.flash.swf'}],
                        file: '@Url.Content("~/uploads/" + @objMontor.UrlFile)',
                        autostart: 'false',
                        type: 'mp3',
                        width: '200',
                        height: '30'
                    });
                </script>
            </td>
        </tr>
        strIdVoice++;
    }
</table>
<h2>
    Cập nhật file monitor</h2>
@using (Html.BeginForm())
{
    @Html.Hidden("CampId", ViewData["IdCamp"]);
    @Html.Hidden("IdStation", ViewData["IdStation"]);                                              
    <div style="width: 960px">
        <div style="float: left; width: 230px;">
            @Html.TextBox("txtDay", DateTime.Now.ToString("yyyy-MM-dd"))
        </div>
        <div style="float: left; width: 200px;">
            <div id="dvUpload">
                <input id="txtUrl" name="txtUrl" type="hidden" value="" />&nbsp;
            </div>
        </div>
    </div>
    <div style="clear: both">
    </div>
    <div style="float: left; width: 100px;">
        <input type="submit" value="Cập nhật" name="btnSubmit" />
    </div>
}
<div style="clear: both">
</div>
<div style="margin-top: 10px">
    @Html.ActionLink("Danh sách nhà đài", "ListStation", new { id = ViewData["IdCamp"], name = 1 })
</div>
